package cn.itsource.itsource.controller;

import cn.itsource.itsource.domain.Employee;
import cn.itsource.itsource.query.EmployeeQuery;
import cn.itsource.itsource.service.IEmployeeService;
import cn.itsource.itsource.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/emp")
public class EmployeeController {
    @Autowired
    private IEmployeeService employeeService;

    @PostMapping("/pagelist")

    public AjaxResult pageList(@RequestBody EmployeeQuery query){

        return employeeService.pageList(query);
    }

    @PostMapping("/saveorupdate")
    @ResponseBody
    public AjaxResult saveOrUpdate(@RequestBody Employee emp){

        return employeeService.saveOrUpdate(emp);
    }

}
